package com.scalar.chiptrack.finance.openpo.actioncommands;

import com.scalar.chiptrack.ChipTrackExtendedAction;
import com.scalar.chiptrack.commons.Constants;

/**
 * Author: Phani Raja Kumar
 * Date  : Feb 18, 2005
 * Time  : 2:05:35 PM
 */
public class PurchaseOrderSearchActionCommandFactory implements Constants
{

    private static PurchaseOrderSearchActionCommandFactory sPacfactory;

    public synchronized static PurchaseOrderSearchActionCommandFactory getInstance()
    {
        if ( sPacfactory == null )
        {
            sPacfactory = new PurchaseOrderSearchActionCommandFactory();
        }
        return sPacfactory;
    }

    private PurchaseOrderSearchActionCommandFactory()
    {
    }

    /**
     * Returns the ActionCommand Class that implements businnes logic for the given action
     *
     * @param action
     * @return
     */
    public static ChipTrackExtendedAction getActionCommand( String action )
    {
        if ( ACTION_OPEN_PURCHASE_ORDER_SEARCH.equalsIgnoreCase( action ) )
        {
            return new OpenPurchaseOrderSearchCommand();
        }
        else if( ACTION_CHANGE_PURCHASE_ORDER_SEARCH.equalsIgnoreCase( action ) )
        {
			return new PurchaseOrderSearchCommand();
        }
		else if( ACTION_PENDING_PURCHASE_ORDER_SEARCH.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderSearchCommand();
		}
		else if( ACTION_VIEW_PURCHASE_ORDER_SEARCH.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderSearchCommand();
		}
		else if( ACTION_CANCELLED_PURCHASE_ORDER_SEARCH.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderSearchCommand();
		}

		return null;
    }

}
